<?php

namespace app\libs\SpreedlySDK\Action;

use app\libs\SpreedlySDK\SpreedlyClient;

class PaymentMethodAPI extends SpreedlyClient
{
    /**
     * @param array $body
     * @return mixed|null
     * @throws \GuzzleHttp\Exception\GuzzleException
     * @desc 创建支付
     * @doc https://developer.spreedly.com/reference/create-payment-method
     */
    public function create_payment_method(array $body)
    {
        return $this->setPath(sprintf("/%s/payment_methods.json",self::API_VERSION))
            ->setOption(['json'=>$body])
            ->setMethod(self::HTTP_METHOD_POST)
            ->send();
    }
}